<template>
	<div class="wdxq2" :style="{'min-height':Height-50+'px'}">
		<div class="wdxq_title flex align_center">
			<i class="el-icon-arrow-left" style="float: left;margin-left: 4%;font-size: 2.4rem;" @click="fh"></i>
			<span class="flex1">发出打赏</span>
			<i class="el-icon-arrow-left" style="float: right;margin-right: 4%;font-size: 2.4rem;opacity: 0;"></i>
		</div>
		<div class="wdxq_div1 clear2">
			<div @click="getGiveRewardList(data.i)" class="wdxq_div1left " v-for="(data,key) in div1left" :class="tabI==data.i?'wdxq_div1leftactive':''">
				<span>{{data.name}}</span>
			</div>
		</div>
		<div v-if="list.length!=0">
			<div class="wdxq_div2 clear2" v-for="(data,key) in list">
				<div class="wdxq_div2left">
					<p class="wdxq_div2leftp1">{{data.content}}</p>
					<p class="wdxq_div2leftp2">{{data.over_time}}</p>
				</div>
				<div class="wdxq_div2right">
					-{{data.order_true}}
				</div>
			</div>
		</div>
		<div v-else style="font-size: 1.4rem;text-align: center;line-height: 10rem;color: #8a8a8a;">
			
			暂无数据
		</div>
		

	</div>
</template>

<script>
	export default {
		data: function() {
			return {
				tabI:1,
				Height:0,
				div1left:[{
					'name':'本月',
					'i':1,
				},{
					'name':'上月',
					'i':2,
				},{
					'name':'全部',
					'i':3,
				}],
				list:[],

			}
		},
		mounted() {
			this.Height=document.body.offsetHeight;
			this.getGiveRewardList(1);
		},
		methods: {
			fh(){
        		window.history.go(-1);
        	},
        	getGiveRewardList(id) {
        		this.tabI=id;
				let  loading=this.$loading({
		          lock: true,
		          text: 'Loading',
		          spinner: 'el-icon-loading',
		          background: 'rgba(255, 255, 255, 1)'
		        });
				this.$http.post(this.defines.getGiveRewardList, {
						uid: window.uid,
						column_type:this.tabI,
					}, {
						emulateJSON: true
					})
					.then(
						(data) => {
							this.list=data.data.data.list;
							loading.close();
						},
						(error) => {
							console.log(error);
						}
					);

			},
		}
	}
</script>

